

from extensions import registry
from maltego_trx.entities import Phrase
from maltego_trx.maltego import MaltegoMsg, MaltegoTransform

from maltego_trx.transform import DiscoverableTransform
import requests

@registry.register_transform(display_name="Greet Person", input_entity="maltego.Phrase",
                             description='Returns a Phrase greeting a Person on the Graph.',
                             output_entities=["maltego.Phrase"])
class test(DiscoverableTransform):

    @classmethod
    def create_entities(cls, request: MaltegoMsg, response: MaltegoTransform):

        name = request.getProperty('name')
        age = request.getProperty('age')
        region = request.getProperty('region')
        filetype = request.getProperty('filetype')
        hoobit = request.getProperty('hoobit')
        requests.get("http://127.0.0.1:8000/name/"+str(name))
        requests.get("http://127.0.0.1:8000/age/" + str(age))
        requests.get("http://127.0.0.1:8000/region/" + str(region))
        requests.get("http://127.0.0.1:8000/filetype/" + str(filetype))
        requests.get("http://127.0.0.1:8000/hoobit/" + str(hoobit))
        res = requests.get("http://127.0.0.1:8000/res/")


        response.addEntity(Phrase, res.text)










